SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].gspEmailTemplateType_SEARCH
(
@emailTemplateTypeId int = null,
@name nvarchar(128) = null,
@emailTemplateTypeCode int = null
)
AS

SELECT
  *
FROM
  [dbo].[EmailTemplateType]
WHERE
  (@emailTemplateTypeId IS NULL OR [EmailTemplateTypeId] = @emailTemplateTypeId)
AND
  (@name IS NULL OR @name = '' OR [Name] LIKE @name + '%')
AND
  (@emailTemplateTypeCode IS NULL OR [EmailTemplateTypeCode] = @emailTemplateTypeCode)


GO
